package yawning.mew.character;

import java.util.HashMap;
import java.util.Map;

public enum Profession {
	// We only care about primary professions.
	ALCHEMY("Alchemy", 171),
	BLACKSMITHING("Blacksmithing", 164),
	ENCHANTING("Enchanting", 333),
	ENGINEERING("Engineering", 202),
	HERBALISM("Herbalism", 182),
	INSCRIPTION("Inscription", 773),
	JEWELCRAFTING("Jewelcrafting", 755),
	LEATEHRWORKING("Leatherworking", 165),
	MINING("Mining", 186),
	SKINNING("Skinning", 393),
	TAILORING("Tailoring", 197);

	String mName;
	int mProfId;

	public static Profession get(int i) {
		if (sProfMap.size() == 0) {
			synchronized (sProfMap) {
				if (sProfMap.size() == 0) {
					for (Profession p : values()) sProfMap.put(p.mProfId, p);
				}
			}
		}

		return sProfMap.get(i);
	}

	@Override
	public String toString() {
		return mName;
	}

	private Profession(String name, int pid) {
		mName = name;
		mProfId = pid;
	}

	private static Map<Integer,Profession> sProfMap = new HashMap<Integer,Profession>();

}
